﻿using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
namespace INTEX.DataBase.Tools
{
    public partial class INTEXDBC
    {
        public DataSet QueryMSEINKL(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM MSEINKL WHERE  ROWNUM<2 ";
                    break;
                case 1:
                    break;
                case 2:
                    or1.CommandText = "SELECT * FROM MSEINKL  "
                            + " WHERE MSEMANDANT=:MSEMANDANT AND MSEMAT=:MSEMAT AND MSEVAR=:MSEVAR";
                    or1.Parameters.Add("MSEMANDANT", OracleType.NVarChar).Value = dwData["MSEMANDANT"].ToString();
                    or1.Parameters.Add("MSEMAT", OracleType.NVarChar).Value = dwData["MSEMAT"].ToString();
                    or1.Parameters.Add("MSEVAR", OracleType.NVarChar).Value = dwData["MSEVAR"].ToString();
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "MSEINKL";
            Return = Result;
            return Return;
        }
    }
}
